package com.xin.chaingeneration.service;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class KafkaConsumerComponent {
    @KafkaListener(topics = "event", groupId = "test-group")
    public void listen(ConsumerRecord<String, String> record) {
        log.info("Received Message in group 'test-group':");
        log.info("Key: " + record.key() + ", Value: " + record.value());
    }
}